package com.bankcomm.luafuction;

import org.keplerproject.luajava.LuaState;
import org.keplerproject.luajava.LuaStateFactory;

import android.os.Looper;

import com.rytong.tools.ui.Component;

public class LuaLib {
    public LuaAccelerometer accelerometer_;
    LuaDocument ld_;

    // 将Lua的window对应到LuaWindow对象上
    LuaWindow lw_;

    // 将Lua的screen对应到LuaScreen对象上
    LuaScreen ls_;
    LuaDatabase ldb_;
    LuaUtility lu_;
    LuaLocation ll_;
    LuaHistory lh_;
    LuaHTTP lhttp_;
    public LuaAudio la_;
    LuaTimer lt_;
    LuaSystem lsystem_;
    public LuaFile lf_;
    LuaJson lj_;
    public LuaVideo lv_;
    LuaAnimation laa_;
    LuaTransition ltt_;
    LuaPrint lp_;
    LuaGesture lg_;

    public LuaLib() {
        // TODO Auto-generated constructor stub
        if (Thread.currentThread().getId() != 1)
            Looper.prepare();
        Component.LUASTATE = LuaStateFactory.newLuaState();
        Component.LUASTATE.openLibs();
        Component.LUASTATE.gc(LuaState.LUA_GCRESTART, 0);
        // 将Lua的document对应到LuaDocument对象上
        LuaDocument ld = new LuaDocument();

        // 将Lua的window对应到LuaWindow对象上
        LuaWindow lw = new LuaWindow();

        // 将Lua的screen对应到LuaScreen对象上
        LuaScreen ls = new LuaScreen();
        LuaDatabase ldb = new LuaDatabase();
        LuaUtility lu = new LuaUtility();
        LuaLocation ll = new LuaLocation();
        LuaHistory lh = new LuaHistory();
        LuaHTTP lhttp = new LuaHTTP();
        LuaAudio la = new LuaAudio();
        LuaTimer lt = new LuaTimer();
        LuaSystem lsystem = new LuaSystem();
        LuaFile lf = new LuaFile();
        LuaJson lj = new LuaJson();
        accelerometer_ = new LuaAccelerometer();
        LuaVideo video = new LuaVideo();
        LuaAnimation laa = new LuaAnimation();
        LuaTransition ltt = new LuaTransition();
        LuaPrint lp = new LuaPrint();
        LuaGesture lg = new LuaGesture();
        LuaGPS lGps = new LuaGPS();
    }
}
